package com.budwk.app.sqfw.enums;

import lombok.Getter;

/**
 * 进家入户宣传台账
 */
@Getter
public enum HouseSurveyEnum {

    //    WINTER_PARTROL(1, "冬巡"),
    WINTER_PARTROL(1, "入户安全巡查"),
    SAFETY_PROMOTION(1, "安全宣传"),
    SIX_TYPES_PERSON_LEDGER(2, "特殊人员巡查台账"),
    SIX_KEYNOTE_TABLE_STATIS(3, "六类重点人员分类数据统计表"),
    HOME_PROMOTION_LEDGER(4, "进家入户宣传台账"),
    RUBBISH_CLASSIFICATION_PUBLICIZE(5, "垃圾分类"),
    NINE_TYPES_OF_PERSONNEL_PATROL(6, "九类人员巡查");


    private Integer code;

    private String name;

    HouseSurveyEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * @param code
     * @return
     */
    public static String getName(Integer code) {
        for (HouseSurveyEnum o : HouseSurveyEnum.values()) {
            if (o.getCode() == code) {
                return o.getName();
            }
        }
        return null;
    }

    /**
     * @param name
     * @return
     */
    public static Integer getCode(String name) {
        for (HouseSurveyEnum o : HouseSurveyEnum.values()) {
            if (o.getName().equals(name)) {
                return o.getCode();
            }
        }
        return null;
    }
}
